]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Desaturate appmenu icon
authorFlorian Müllner <fmuellner@gnome.org>
Mon, 4 Feb 2019 23:30:41 +0000 (00:30 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Feb 2019 17:29:15 +0000 (18:29 +0100)
Top bar icons are supposed to by symbolic, but not all applications
provide a symbolic icon. Make the stick out less by desaturating
the appmenu icon if a symbolic style is requested.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/624

js/ui/panel.js

index e67a0fd9aa245a0a86737f3b93c57b2748b18a25..fb846fc6290fcf784359ac70a62a458d801d88bf 100644 (file)
@@ -222,9 +222,16 @@ var AppMenuButton = GObject.registerClass({
         textureCache.connect('icon-theme-changed',
                              this._onIconThemeChanged.bind(this));
 
+        let iconEffect = new Clutter.DesaturateEffect();
         this._iconBox = new St.Bin({ style_class: 'app-menu-icon' });
+        this._iconBox.add_effect(iconEffect);
         this._container.add_actor(this._iconBox);
 
+        this._iconBox.connect('style-changed', () => {
+            let themeNode = this._iconBox.get_theme_node();
+            iconEffect.enabled = themeNode.get_icon_style() == St.IconStyle.SYMBOLIC;
+        });
+
         this._label = new St.Label({ y_expand: true,
                                      y_align: Clutter.ActorAlign.CENTER });
         this._container.add_actor(this._label);